package com.yby.algorithm.lru;

public class LRUTest {

    public static void main(String[] args) {
        LRUCache lruCache = new LRUCache(8);
        for (int i = 0; i < 100; i++) {
            lruCache.put(String.valueOf(i), "value:" + i);
        }
        System.out.println("初始化后的lru链表");
        System.out.println(lruCache.size());
        lruCache.forEach();
        System.out.println("获取元素3");
        System.out.println(lruCache.get(String.valueOf(3)));
        System.out.println("获取元素3的后lru链表");
        lruCache.forEach();
        System.out.println("添加元素100后的lru链表");
        lruCache.put(String.valueOf(100), "value:" + 100);
        lruCache.forEach();
    }
}
